# @Author   : 懒羊羊
# @File     : day02.py
# @Time     : 2024/12/4 10:24
import time

from selenium import webdriver
from selenium.webdriver.common.by import By

wd = webdriver.Chrome()

wd.get(
    "file:///D:/Program%20Files%20(x86)/Tencent/WeChat/WeChat%20Files/WeChat%20Files/wxid_ftrjqdp67drl22/FileStorage/File/2024-12/alert.html")

wd.find_element(By.XPATH, "//input[@value='输入框弹窗按钮']").click()

alert = wd.switch_to.alert

alert.send_keys("1")
time.sleep(2)
alert.accept()

time.sleep(2)
wd.quit()
